package com.xcroot.chapter03;

/**
 * Created by CRoot on 2017/9/20.
 */
public class CRectangle {
    int length, width;

    public CRectangle(int length, int width) {
        this.length = length;
        this.width = width;
    }

    public CRectangle(){
    }

    public int getPerimeter() {
        return (this.length + this.width) * 2;
    }

    public int getArea() {
        return this.length * this.width;
    }
}

class CSquare extends CRectangle{
    public CSquare(int length, int width){
        super(length,width);
    }
}